home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / VB98 / WIZARDS / APPWIZ.OCX / 1033 / TEXT / STDINFO
Encoding:
Text File  |  1998-06-26  |  20.0 KB  |  684 lines

  1. *ABOUTFRM
  2. ' Reg Key Security Options...
  3. Const KEY_ALL_ACCESS = &H2003F
  4.                      
  5. ' Reg Key ROOT Types...
  6. Const HKEY_LOCAL_MACHINE = &H80000002
  7. Const ERROR_SUCCESS = 0
  8. Const REG_SZ = 1                         ' Unicode nul terminated string
  9. Const REG_DWORD = 4                      ' 32-bit number
  10.  
  11. Const gREGKEYSYSINFOLOC = "SOFTWARE\Microsoft\Shared Tools Location"
  12. Const gREGVALSYSINFOLOC = "MSINFO"
  13. Const gREGKEYSYSINFO = "SOFTWARE\Microsoft\Shared Tools\MSINFO"
  14. Const gREGVALSYSINFO = "PATH"
  15.  
  16. Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
  17. Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
  18. Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
  19.  
  20. Private Sub cmdSysInfo_Click()
  21.     Call StartSysInfo
  22. End Sub
  23.  
  24. Private Sub cmdOK_Click()
  25.     Unload Me
  26. End Sub
  27.  
  28. Public Sub StartSysInfo()
  29.   On Error GoTo SysInfoErr
  30.  
  31.     Dim rc As Long
  32.     Dim SysInfoPath As String
  33.     
  34.     ' Try To Get System Info Program Path\Name From Registry...
  35.     If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
  36.     ' Try To Get System Info Program Path Only From Registry...
  37.     ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
  38.         ' Validate Existance Of Known 32 Bit File Version
  39.         If (Dir(SysInfoPath & "\MSINFO32.EXE") <> "") Then
  40.             SysInfoPath = SysInfoPath & "\MSINFO32.EXE"
  41.             
  42.         ' Error - File Can Not Be Found...
  43.         Else
  44.             GoTo SysInfoErr
  45.         End If
  46.     ' Error - Registry Entry Can Not Be Found...
  47.     Else
  48.         GoTo SysInfoErr
  49.     End If
  50.     
  51.     Call Shell(SysInfoPath, vbNormalFocus)
  52.     
  53.     Exit Sub
  54. SysInfoErr:
  55.     MsgBox "System Information Is Unavailable At This Time", vbOKOnly
  56. End Sub
  57.  
  58. Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
  59.     Dim i As Long                                           ' Loop Counter
  60.     Dim rc As Long                                          ' Return Code
  61.     Dim hKey As Long                                        ' Handle To An Open Registry Key
  62.     Dim hDepth As Long                                      '
  63.     Dim KeyValType As Long                                  ' Data Type Of A Registry Key
  64.     Dim tmpVal As String                                    ' Tempory Storage For A Registry Key Value
  65.     Dim KeyValSize As Long                                  ' Size Of Registry Key Variable
  66.     '------------------------------------------------------------
  67.     ' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
  68.     '------------------------------------------------------------
  69.     rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' Open Registry Key
  70.     
  71.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Error...
  72.     
  73.     tmpVal = String$(1024, 0)                             ' Allocate Variable Space
  74.     KeyValSize = 1024                                       ' Mark Variable Size
  75.     
  76.     '------------------------------------------------------------
  77.     ' Retrieve Registry Key Value...
  78.     '------------------------------------------------------------
  79.     rc = RegQueryValueEx(hKey, SubKeyRef, 0, KeyValType, tmpVal, KeyValSize)    ' Get/Create Key Value
  80.                         
  81.     If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError          ' Handle Errors
  82.     
  83.     tmpVal = VBA.Left(tmpVal, InStr(tmpVal, VBA.Chr(0)) - 1)
  84.     '------------------------------------------------------------
  85.     ' Determine Key Value Type For Conversion...
  86.     '------------------------------------------------------------
  87.     Select Case KeyValType                                  ' Search Data Types...
  88.     Case REG_SZ                                             ' String Registry Key Data Type
  89.         KeyVal = tmpVal                                     ' Copy String Value
  90.     Case REG_DWORD                                          ' Double Word Registry Key Data Type
  91.         For i = Len(tmpVal) To 1 Step -1                    ' Convert Each Bit
  92.             KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1)))   ' Build Value Char. By Char.
  93.         Next
  94.         KeyVal = Format$("&h" + KeyVal)                     ' Convert Double Word To String
  95.     End Select
  96.     
  97.     GetKeyValue = True                                      ' Return Success
  98.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  99.     Exit Function                                           ' Exit
  100.     
  101. GetKeyError:    ' Cleanup After An Error Has Occured...
  102.     KeyVal = ""                                             ' Set Return Val To Empty String
  103.     GetKeyValue = False                                     ' Return Failure
  104.     rc = RegCloseKey(hKey)                                  ' Close Registry Key
  105. End Function
  106. *END
  107.  
  108. *LOGINFRM
  109. Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
  110.  
  111. Public OK As Boolean
  112.  
  113. Private Sub cmdCancel_Click()
  114.   OK = False
  115.   Me.Hide
  116. End Sub
  117.  
  118. Private Sub cmdOK_Click()
  119.   'ToDo: create test for correct password
  120.   'check for correct password
  121.   If txtPassword.Text = "" Then
  122.     OK = True
  123.     Me.Hide
  124.   Else
  125.     MsgBox "Invalid Password, try again!", , "Login"
  126.     txtPassword.SetFocus
  127.     txtPassword.SelStart = 0
  128.     txtPassword.SelLength = Len(txtPassword.Text)
  129.   End If
  130. End Sub
  131. *END
  132.  
  133. *OPTIONFRM
  134. Private Sub cmdApply_Click()
  135.   'ToDo: Add 'cmdApply_Click' code.
  136.   MsgBox "Apply Code goes here to set options w/o closing dialog!"
  137. End Sub
  138.  
  139. Private Sub cmdCancel_Click()
  140.   Unload Me
  141. End Sub
  142.  
  143. Private Sub cmdOK_Click()
  144.   'ToDo: Add 'cmdOK_Click' code.
  145.   MsgBox "Code goes here to set options and close dialog!"
  146.   Unload Me
  147. End Sub
  148.  
  149. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  150.   Dim i As Integer
  151.   i = tbsOptions.SelectedItem.index
  152.   'handle ctrl+tab to move to the next tab
  153.   If (Shift And 3) = 2 And KeyCode = vbKeyTab Then
  154.     If i = tbsOptions.Tabs.Count Then
  155.       'last tab so we need to wrap to tab 1
  156.       Set tbsOptions.SelectedItem = tbsOptions.Tabs(1)
  157.     Else
  158.       'increment the tab
  159.       Set tbsOptions.SelectedItem = tbsOptions.Tabs(i + 1)
  160.     End If
  161.   ElseIf (Shift And 3) = 3 And KeyCode = vbKeyTab Then
  162.     If i = 1 Then
  163.       'last tab so we need to wrap to tab 1
  164.       Set tbsOptions.SelectedItem = tbsOptions.Tabs(tbsOptions.Tabs.Count)
  165.     Else
  166.       'increment the tab
  167.       Set tbsOptions.SelectedItem = tbsOptions.Tabs(i - 1)
  168.     End If
  169.   End If
  170. End Sub
  171.  
  172. Private Sub tbsOptions_Click()
  173.   
  174.   Dim i As Integer
  175.   'show and enable the selected tab's controls
  176.   'and hide and disable all others
  177.   For i = 0 To tbsOptions.Tabs.Count - 1
  178.     If i = tbsOptions.SelectedItem.Index - 1 Then
  179.       picOptions(i).Left = 210
  180.       picOptions(i).Enabled = True
  181.     Else
  182.       picOptions(i).Left = -20000
  183.       picOptions(i).Enabled = False
  184.     End If
  185.   Next
  186.   
  187. End Sub
  188. *END
  189.  
  190. *MENU_OPEN_SDI
  191.   Dim sFile As String
  192.  
  193.   With dlgCommonDialog
  194.     .DialogTitle = "Open"
  195.     .CancelError = False
  196.     'ToDo: set the flags and attributes of the common dialog control
  197.     .Filter = "All Files (*.*)|*.*"
  198.     .ShowOpen
  199.     If Len(.FileName) = 0 Then
  200.       Exit Sub
  201.     End If
  202.     sFile = .FileName
  203.   End With
  204.   'ToDo: add code to process the opened file
  205. *END
  206.  
  207. *MENU_SAVEAS_SDI
  208.   'ToDo: Setup the common dialog control prior to calling ShowSave
  209.   With dlgCommonDialog
  210.     .DialogTitle = "Save As"
  211.     .CancelError = False
  212.     .ShowSave
  213.   End With
  214. *END
  215.  
  216. *MENU_OPEN_MDI
  217.   Dim sFile As String
  218.  
  219.   If ActiveForm Is Nothing Then LoadNewDoc
  220.   
  221.   With dlgCommonDialog
  222.     .DialogTitle = "Open"
  223.     .CancelError = False
  224.     'ToDo: set the flags and attributes of the common dialog control
  225.     .Filter = "All Files (*.*)|*.*"
  226.     .ShowOpen
  227.     If Len(.filename) = 0 Then
  228.       Exit Sub
  229.     End If
  230.     sFile = .filename
  231.   End With
  232.   ActiveForm.rtfText.LoadFile sFile
  233.   ActiveForm.Caption = sFile
  234. *END
  235.  
  236. *MENU_SAVE_MDI
  237.   Dim sFile As String
  238.   If Left$(ActiveForm.Caption, 8) = "Document" Then
  239.     With dlgCommonDialog
  240.       .DialogTitle = "Save"
  241.       .CancelError = False
  242.       'ToDo: set the flags and attributes of the common dialog control
  243.       .Filter = "All Files (*.*)|*.*"
  244.       .ShowSave
  245.       If Len(.filename) = 0 Then
  246.         Exit Sub
  247.       End If
  248.       sFile = .filename
  249.     End With
  250.     ActiveForm.rtfText.SaveFile sFile
  251.   Else
  252.     sFile = ActiveForm.Caption
  253.     ActiveForm.rtfText.SaveFile sFile
  254.   End If
  255. *END
  256.  
  257. *MENU_SAVEAS_MDI
  258.   Dim sFile As String
  259.   
  260.   If ActiveForm Is Nothing Then Exit Sub
  261.   
  262.   With dlgCommonDialog
  263.     .DialogTitle = "Save As"
  264.     .CancelError = False
  265.     'ToDo: set the flags and attributes of the common dialog control
  266.     .Filter = "All Files (*.*)|*.*"
  267.     .ShowSave
  268.     If Len(.filename) = 0 Then
  269.       Exit Sub
  270.     End If
  271.     sFile = .filename
  272.   End With
  273.   ActiveForm.Caption = sFile
  274.   ActiveForm.rtfText.SaveFile sFile
  275. *END
  276.  
  277. *MENU_COPY_MDI
  278.   On Error Resume Next
  279.   Clipboard.SetText ActiveForm.rtfText.SelRTF
  280. *END
  281.  
  282. *MENU_CUT_MDI
  283.   On Error Resume Next
  284.   Clipboard.SetText ActiveForm.rtfText.SelRTF
  285.   ActiveForm.rtfText.SelText = vbNullString
  286. *END
  287.  
  288. *MENU_PRINT_MDI
  289.   On Error Resume Next
  290.   If ActiveForm Is Nothing Then Exit Sub
  291.   
  292.   With dlgCommonDialog
  293.     .DialogTitle = "Print"
  294.     .CancelError = True
  295.     .Flags = cdlPDReturnDC + cdlPDNoPageNums
  296.     If ActiveForm.rtfText.SelLength = 0 Then
  297.       .Flags = .Flags + cdlPDAllPages
  298.     Else
  299.       .Flags = .Flags + cdlPDSelection
  300.     End If
  301.     .ShowPrinter
  302.     If Err <> mscomdlg.cdlCancel Then
  303.       ActiveForm.rtfText.SelPrint .hDC
  304.     End If
  305.   End With
  306. *END
  307.  
  308. *MENU_PASTE_MDI
  309.   On Error Resume Next
  310.   ActiveForm.rtfText.SelRTF = Clipboard.GetText
  311. *END
  312.  
  313. *MENU_PAGESETUP
  314.   On Error Resume Next
  315.   With dlgCommonDialog
  316.     .DialogTitle = "Page Setup"
  317.     .CancelError = True
  318.     .ShowPrinter
  319.   End With
  320. *END
  321.  
  322. *MENU_EXIT
  323.   'unload the form
  324.   Unload Me
  325. *END
  326.  
  327. *MENU_ARRANGEICONS
  328. Const NAME_COLUMN = 0
  329. Const TYPE_COLUMN = 1
  330. Const SIZE_COLUMN = 2
  331. Const DATE_COLUMN = 3
  332.  
  333. Private Sub mnuVAIByDate_Click()
  334.   'ToDo: Add 'mnuVAIByDate_Click' code.
  335. '  lvListView.SortKey = DATE_COLUMN
  336. End Sub
  337.  
  338. Private Sub mnuVAIByName_Click()
  339.   'ToDo: Add 'mnuVAIByName_Click' code.
  340. '  lvListView.SortKey = NAME_COLUMN
  341. End Sub
  342.  
  343. Private Sub mnuVAIBySize_Click()
  344.   'ToDo: Add 'mnuVAIBySize_Click' code.
  345. '  lvListView.SortKey = SIZE_COLUMN
  346. End Sub
  347.  
  348. Private Sub mnuVAIByType_Click()
  349.   'ToDo: Add 'mnuVAIByType_Click' code.
  350. '  lvListView.SortKey = TYPE_COLUMN
  351. End Sub
  352. *END
  353.  
  354. *MENU_LISTVIEWMODE
  355. Private Sub mnuListViewMode_Click(Index As Integer)
  356.   On Error Resume Next
  357.   'uncheck the current type
  358.   mnuListViewMode(lvListView.View).Checked = False
  359.   'set the listview mode
  360.   lvListView.View = Index
  361.   'check the new type
  362.   mnuListViewMode(Index).Checked = True
  363. *END
  364.  
  365. *MENU_LISTVIEWMODE2
  366.   'set the toolbar to the same new type
  367.   Select Case lvListView.View
  368.     Case lvwIcon
  369.       tbToolBar.Buttons(LISTVIEW_MODE0).Value = tbrPressed
  370.     Case lvwSmallIcon
  371.       tbToolBar.Buttons(LISTVIEW_MODE1).Value = tbrPressed
  372.     Case lvwList
  373.       tbToolBar.Buttons(LISTVIEW_MODE2).Value = tbrPressed
  374.     Case lvwReport
  375.       tbToolBar.Buttons(LISTVIEW_MODE3).Value = tbrPressed
  376.   End Select
  377. End Sub
  378. *END
  379.  
  380. *MENU_HELPCONTENTS
  381.   Dim nRet As Integer
  382.  
  383.   'if there is no helpfile for this project display a message to the user
  384.   'you can set the HelpFile for your application in the
  385.   'Project Properties dialog
  386.   If Len(App.HelpFile) = 0 Then
  387.     MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption
  388.   Else
  389.     On Error Resume Next
  390.     nRet = OSWinHelp(Me.hwnd, App.HelpFile, 3, 0)
  391.     If Err Then
  392.       MsgBox Err.Description
  393.     End If
  394.   End If
  395. *END
  396.  
  397. *MENU_HELPSEARCH
  398.   Dim nRet As Integer
  399.  
  400.   'if there is no helpfile for this project display a message to the user
  401.   'you can set the HelpFile for your application in the
  402.   'Project Properties dialog
  403.   If Len(App.HelpFile) = 0 Then
  404.     MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption
  405.   Else
  406.     On Error Resume Next
  407.     nRet = OSWinHelp(Me.hwnd, App.HelpFile, 261, 0)
  408.     If Err Then
  409.       MsgBox Err.Description
  410.     End If
  411.   End If
  412. *END
  413.  
  414.  
  415. *LOADRES 
  416. Sub LoadResStrings(frm As Form)
  417.   On Error Resume Next
  418.  
  419.   Dim ctl As Control
  420.   Dim obj As Object
  421.   Dim fnt As Object
  422.   Dim sCtlType As String
  423.   Dim nVal As Integer
  424.  
  425.   'set the form's caption
  426.   frm.Caption = LoadResString(CInt(frm.Tag))
  427.   
  428.   'set the font
  429.   Set fnt = frm.Font
  430.   fnt.Name = LoadResString(20)
  431.   fnt.Size = CInt(LoadResString(21))
  432.   
  433.   'set the controls' captions using the caption
  434.   'property for menu items and the Tag property
  435.   'for all other controls
  436.   For Each ctl In frm.Controls
  437.     Set ctl.Font = fnt
  438.     sCtlType = TypeName(ctl)
  439.     If sCtlType = "Label" Then
  440.       ctl.Caption = LoadResString(CInt(ctl.Tag))
  441.     ElseIf sCtlType = "Menu" Then
  442.       ctl.Caption = LoadResString(CInt(ctl.Caption))
  443.     ElseIf sCtlType = "TabStrip" Then
  444.       For Each obj In ctl.Tabs
  445.         obj.Caption = LoadResString(CInt(obj.Tag))
  446.         obj.ToolTipText = LoadResString(CInt(obj.ToolTipText))
  447.       Next
  448.     ElseIf sCtlType = "Toolbar" Then
  449.       For Each obj In ctl.Buttons
  450.         obj.ToolTipText = LoadResString(CInt(obj.ToolTipText))
  451.       Next
  452.     ElseIf sCtlType = "ListView" Then
  453.       For Each obj In ctl.ColumnHeaders
  454.         obj.Text = LoadResString(CInt(obj.Tag))
  455.       Next
  456.     Else
  457.       nVal = 0
  458.       nVal = Val(ctl.Tag)
  459.       If nVal > 0 Then ctl.Caption = LoadResString(nVal)
  460.       nVal = 0
  461.       nVal = Val(ctl.ToolTipText)
  462.       If nVal > 0 Then ctl.ToolTipText = LoadResString(nVal)
  463.     End If
  464.   Next
  465.  
  466. End Sub
  467. *END
  468.  
  469. *CHILDFORM
  470. Private Sub Form_Load()
  471.   Form_Resize
  472. End Sub
  473.  
  474. Private Sub Form_Resize()
  475.   On Error Resume Next
  476.   rtfText.Move 100, 100, Me.ScaleWidth - 200, Me.ScaleHeight - 200
  477.   rtfText.RightMargin = rtfText.Width - 400
  478. End Sub
  479. *END
  480.  
  481. *TVLV    
  482. Dim mbMoving As Boolean
  483. Const sglSplitLimit = 500
  484.  
  485. Private Sub Form_Resize()
  486.   On Error Resume Next
  487.   If Me.Width < 3000 Then Me.Width = 3000
  488.   SizeControls imgSplitter.Left
  489. End Sub
  490.  
  491. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  492.   With imgSplitter
  493.     picSplitter.Move .Left, .Top, .Width \ 2, .Height - 20
  494.   End With
  495.   picSplitter.Visible = True
  496.   mbMoving = True
  497. End Sub
  498.  
  499. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  500.   Dim sglPos As Single
  501.   
  502.   If mbMoving Then
  503.     sglPos = X + imgSplitter.Left
  504.     If sglPos < sglSplitLimit Then
  505.       picSplitter.Left = sglSplitLimit
  506.     ElseIf sglPos > Me.Width - sglSplitLimit Then
  507.       picSplitter.Left = Me.Width - sglSplitLimit
  508.     Else
  509.       picSplitter.Left = sglPos
  510.     End If
  511.   End If
  512. End Sub
  513.  
  514. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  515.   SizeControls picSplitter.Left
  516.   picSplitter.Visible = False
  517.   mbMoving = False
  518. End Sub
  519.  
  520. Private Sub TreeView1_DragDrop(Source As Control, X As Single, Y As Single)
  521.   If Source = imgSplitter Then
  522.     SizeControls X
  523.   End If
  524. End Sub
  525.  
  526. Sub SizeControls(X As Single)
  527.   On Error Resume Next
  528.   
  529.   'set the width
  530.   If X < 1500 Then X = 1500
  531.   If X > (Me.Width - 1500) Then X = Me.Width - 1500
  532.   tvTreeView.Width = X
  533.   imgSplitter.Left = X
  534.   lvListView.Left = X + 40
  535.   lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  536.   lblTitle(0).Width = tvTreeView.Width 
  537.   lblTitle(1).Left = lvListView.Left + 20
  538.   lblTitle(1).Width = lvListView.Width - 40
  539.  
  540.   'set the top
  541. *END
  542.  
  543. *TVLV2A    
  544.   If tbToolBar.Visible Then
  545.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  546.   Else
  547.     tvTreeView.Top = picTitles.Height
  548.   End If
  549.  
  550. *END
  551.  
  552. *TVLV2B
  553.   tvTreeView.Top = picTitles.Height
  554.  
  555. *END
  556.  
  557. *TVLV3
  558.   lvListView.Top = tvTreeView.Top
  559.   
  560.   'set the height
  561.   If sbStatusBar.Visible Then
  562.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height + sbStatusBar.Height)
  563.   Else
  564.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  565.   End If
  566.   
  567.   lvListView.Height = tvTreeView.Height
  568.   imgSplitter.Top = tvTreeView.Top
  569.   imgSplitter.Height = tvTreeView.Height
  570. End Sub
  571. *END
  572.  
  573. *RESOURCE
  574. Resource Files
  575. ==============
  576. A resource file has added to your project.  To make changes to the resource file, use the "VB Resource (RES) Editor" add-in.
  577. *END
  578.  
  579. *INSTRUCT1
  580. The Application Wizard has finished creating your application.  Throughout the project, you will find code comments indicating what you should do to add your own functionality to the project.  Search for "ToDo" in the comments within the project for more information.
  581.  
  582. What To Do Next
  583. ===============
  584. You can save this report by clicking the "Save" button, or you can discard it by clicking "Close".  Once you are returned to the Visual Basic environment, run your application!  Press F5 or choose Start from the Run menu.
  585. *END
  586.  
  587. *INSTRUCT2A
  588. The Application Wizard has created the foundation for your application.  You can begin by editing the project to fit your needs.
  589. *END
  590.  
  591. *INSTRUCT2B
  592. The Application Wizard has created the foundation for your application.  You can begin by editing the project to fit your needs or you can run these other Wizards to provide more functionality:
  593.  
  594. Data Form Wizard - Add more complex forms based upon your local or remote data sources to your application.
  595.  
  596. Class Builder - Provide a rich object model for your application using this tool.
  597.  
  598. ActiveX Document Wizard - Translate any of the forms in your application to ActiveX Documents using this wizard.
  599. *END
  600.  
  601.  
  602. *BROWSER
  603. Public StartingAddress As String
  604. Dim mbDontNavigateNow As Boolean
  605.  
  606. Private Sub brwWebBrowser_DownloadComplete()
  607.   On Error Resume Next
  608.   Me.Caption = brwWebBrowser.LocationName
  609. End Sub
  610.  
  611. Private Sub brwWebBrowser_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
  612.   On Error Resume Next
  613.   Dim i As Integer
  614.   Dim bFound As Boolean
  615.   Me.Caption = brwWebBrowser.LocationName
  616.   For i = 0 To cboAddress.ListCount - 1
  617.     If cboAddress.List(i) = brwWebBrowser.LocationURL Then
  618.       bFound = True
  619.       Exit For
  620.     End If
  621.   Next i
  622.   mbDontNavigateNow = True
  623.   If bFound Then
  624.     cboAddress.RemoveItem i
  625.   End If
  626.   cboAddress.AddItem brwWebBrowser.LocationURL, 0
  627.   cboAddress.ListIndex = 0
  628.   mbDontNavigateNow = False
  629. End Sub
  630.  
  631. Private Sub cboAddress_Click()
  632.   If mbDontNavigateNow Then Exit Sub
  633.   timTimer.Enabled = True
  634.   brwWebBrowser.Navigate cboAddress.Text
  635. End Sub
  636.  
  637. Private Sub cboAddress_KeyPress(KeyAscii As Integer)
  638.   On Error Resume Next
  639.   If KeyAscii = vbKeyReturn Then
  640.     cboAddress_Click
  641.   End If
  642. End Sub
  643.  
  644. Private Sub Form_Resize()
  645.   On Error Resume Next
  646.   cboAddress.Width = Me.ScaleWidth - 100
  647.   brwWebBrowser.Width = Me.ScaleWidth - 100
  648.   brwWebBrowser.Height = Me.ScaleHeight - (picAddress.Top + picAddress.Height) - 100
  649. End Sub
  650.  
  651. Private Sub timTimer_Timer()
  652.   If brwWebBrowser.Busy = False Then
  653.     timTimer.Enabled = False
  654.     Me.Caption = brwWebBrowser.LocationName
  655.   Else
  656.     Me.Caption = "Working..."
  657.   End If
  658. End Sub
  659.  
  660. Private Sub tbToolBar_ButtonClick(ByVal Button As Button)
  661.   On Error Resume Next
  662.    
  663.   timTimer.Enabled = True
  664.    
  665.   Select Case Button.Key
  666.     Case "Back"
  667.       brwWebBrowser.GoBack
  668.     Case "Forward"
  669.       brwWebBrowser.GoForward
  670.     Case "Refresh"
  671.       brwWebBrowser.Refresh
  672.     Case "Home"
  673.       brwWebBrowser.GoHome
  674.     Case "Search"
  675.       brwWebBrowser.GoSearch
  676.     Case "Stop"
  677.       timTimer.Enabled = False
  678.       brwWebBrowser.Stop
  679.       Me.Caption = brwWebBrowser.LocationName
  680.   End Select
  681.  
  682. End Sub
  683. *END